#include <cstdio>
#include <algorithm>

using namespace std;

struct Node
{
    int a, b;
};

bool cmp1( const Node &a, const Node &b )
{
    return a.a < b.a;
}

bool cmp2( const Node &a, const Node &b )
{
    return a.b < b.b;
}

Node a[ 1000001 ], b [ 1000001 ];
int n, k1, k2;

void init( )
{
    int i;
    for ( i = 0; i < n; i++ )
    {
        scanf("%d", &a[ i ].a);
        a[ i ].b = i + 1;
    }
}

void work( )
{
    int i;
    stable_sort( a, a + n, cmp1 );
    memcpy( b, a, k1 * sizeof( a[ 0 ] ));
    stable_sort( b, b + k1, cmp2 );
    printf("%d", b[ 0 ].b);
    for ( i = 1; i < k1; i++ )
        printf(" %d", b[ i ].b);
    puts("");
    memcpy( b, a + n - k2, k2 * sizeof( a[ 0 ] ));
    stable_sort( b, b + k2, cmp2 );
    printf("%d", b[ k2 - 1 ].b);
    for ( i = k2 - 2; i >= 0; i-- )
        printf(" %d", b[ i ].b);
    puts("");
}

int main( )
{
    int t = 1;
    while ( scanf("%d%d%d", &n, &k1, &k2) != EOF )
    {
        if ( !n && !k1 && !k2 ) break;
        init( );
        printf("Case %d\n", t++);
        work( );
    }
    return 0;
}
